home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.11 Nov 90 / Transition Source / About.c next >
Encoding:
C/C++ Source or Header  |  1990-08-02  |  1.7 KB  |  78 lines  |  [TEXT/KAHL]

  1. /************************************/
  2. /* File: About.c
  3. Function: Handles About Dialog
  4. /************************************/
  5. /* #include files */
  6. #include "General.h"
  7.  
  8. /* Constants */
  9. #define  I_OK   1
  10.  
  11. /* Static Variables and function prototypes */
  12. static char   ExitDialog; 
  13. static void Refresh_Dialog(DialogPtr AboutDialog);
  14.  
  15. /* Globals Variables and Function Prototypes */
  16. void D_About();
  17.  
  18. /************************************/
  19. /* Routines */
  20. /************************************/
  21.  
  22. /************************************/
  23. /* static void Refresh_Dialog(AboutDialog)
  24.     bolds default button */
  25. /************************************/
  26. static void Refresh_Dialog(AboutDialog)
  27. DialogPtr AboutDialog;
  28. Rect    tempRect;
  29. short    DType;
  30. Handle    DItem;
  31.  
  32. GetDItem(AboutDialog,I_OK, &DType, &DItem, &tempRect);
  33. PenSize(3, 3);
  34. InsetRect(&tempRect, -4, -4);
  35. FrameRoundRect(&tempRect, 16, 16); 
  36. PenSize(1, 1); 
  37. } /* static void  Refresh_Dialog(AboutDialog) */
  38.  
  39. /************************************/
  40. /* void D_About()
  41.     Does About Dialog */
  42. /************************************/
  43. void D_About()
  44. {
  45. DialogPtr AboutDialog;
  46. Rect tempRect1, tempRect2;
  47. short itemHit;
  48.      
  49. AboutDialog = GetNewDialog(2, NIL, WindowInFront);
  50.  
  51. tempRect1 = AboutDialog->portRect;
  52. tempRect2 = screenBits.bounds;
  53. tempRect2.top += MenuBarHeight();
  54. PositionRect(&tempRect1, &tempRect2, CENTER, THIRD);
  55. MoveWindow(AboutDialog, tempRect1.left, tempRect1.top, TRUE);
  56.      
  57. ShowWindow(AboutDialog);
  58. SelectWindow(AboutDialog);
  59. SetPort(AboutDialog);
  60.      
  61. Refresh_Dialog(AboutDialog); 
  62.      
  63. ExitDialog = FALSE; 
  64.      
  65. do    {
  66.     ModalDialog(NIL, &itemHit); 
  67.     
  68.     if (itemHit == I_OK ) {
  69.         ExitDialog =TRUE;
  70.         }
  71.     Refresh_Dialog(AboutDialog);
  72.     } while (ExitDialog == FALSE);
  73.      
  74. DisposDialog(AboutDialog); 
  75. } /* void D_About() */
  76.  
  77.